Export public sorting APIs to /sorter#438
Merged
Boshen merged 15 commits intotailwindlabs:mainfrom Feb 5, 2026
Merged
Conversation
2d9e283 to
48a4a97
Compare
48a4a97 to
996fa68
Compare
…f all paths are absolute path
7e601f9 to
82e061f
Compare
/lib/sorter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Continue work on https://github.com/tailwindlabs/prettier-plugin-tailwindcss/tree/feat/public-api
close: #430
Some differences from #430
/sorter, which is a more descriptive entry pointformatterConfigPath, I found this is useless, it is only used to log a warning, I think logbaseis okay.Extra Optimization
843a4dc made an optimization to avoid unnecessary resolution of the Prettier configuration, which is quite expensive!
I think the following
dubbenchmark is at least half as fast due to this optimization because this repo has no Tailwind configuration set.Benchmark
Note:
newmeans the current branch,oldmeans the latest package in npm, so it includes a few optimizations that have already been merged into the main branch, not all in this branch.Benchmark repo: https://github.com/dubinc/dub
Benchmark 1: prettier-tailwindcss-new Time (mean ± σ): 8.038 s ± 0.216 s [User: 12.546 s, System: 0.836 s] Range (min … max): 7.886 s … 8.191 s 2 runs Benchmark 2: prettier-tailwindcss-old Time (mean ± σ): 11.923 s ± 0.060 s [User: 14.954 s, System: 2.520 s] Range (min … max): 11.881 s … 11.966 s 2 runs Benchmark 3: oxfmt-new Time (mean ± σ): 999.8 ms ± 32.1 ms [User: 8968.9 ms, System: 2246.7 ms] Range (min … max): 977.2 ms … 1022.5 ms 2 runs Benchmark 4: oxfmt-old Time (mean ± σ): 1.628 s ± 0.027 s [User: 13.239 s, System: 4.980 s] Range (min … max): 1.609 s … 1.647 s 2 runs Summary oxfmt-new ran 1.63 ± 0.06 times faster than oxfmt-old 8.04 ± 0.34 times faster than prettier-tailwindcss-new 11.93 ± 0.39 times faster than prettier-tailwindcss-oldBenchmark repo: https://github.com/tailwindcsslab/headlessui
Benchmark 1: prettier-tailwindcss-new Time (mean ± σ): 3.588 s ± 0.056 s [User: 6.432 s, System: 0.361 s] Range (min … max): 3.551 s … 3.670 s 4 runs Benchmark 2: prettier-tailwindcss-old Time (mean ± σ): 4.134 s ± 0.108 s [User: 6.919 s, System: 0.611 s] Range (min … max): 4.030 s … 4.246 s 4 runs Benchmark 3: oxfmt-new Time (mean ± σ): 778.8 ms ± 28.9 ms [User: 7633.6 ms, System: 912.9 ms] Range (min … max): 738.3 ms … 806.9 ms 4 runs Benchmark 4: oxfmt-old Time (mean ± σ): 1.033 s ± 0.034 s [User: 10.048 s, System: 1.454 s] Range (min … max): 0.994 s … 1.073 s 4 runs Summary oxfmt-new ran 1.33 ± 0.07 times faster than oxfmt-old 5.61 ± 0.19 times faster than prettier-tailwindcss-new 6.31 ± 0.24 times faster than prettier-tailwindcss-old